package com.meilai.project.constant;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

/**
 * @Description 流程状态类型
 * @Author 张驰
 * @Date 2022-08-16 11:35
 */

@Getter
public enum FlowStatusEnum {
    SAVE(0, "保存"),
    RETURN_BACK(2, "退回"),
    IN_PROCESSING(3, "流程中"),
    PASSED(4, "通过"),
    DELETED(5, "删除"),
    ACTUAL_DELETED(6, "彻底删除");

    @EnumValue
    private final Integer id;
    private final String name;

    FlowStatusEnum(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public static FlowStatusEnum getEnumById(Integer id) {
        for (FlowStatusEnum flowStatusEnum : FlowStatusEnum.values()) {
            if (flowStatusEnum.getId().equals(id)) {
                return flowStatusEnum;
            }
        }
        return null;
    }
}
